export function mockBatteryPassportData(includeValues: boolean = true) {
    // 基础值生成器
    const generateValue = (template: any): any => {
        if (template === null || template === undefined) {
            return template;
        }

        // 处理数组
        if (Array.isArray(template)) {
            if (!includeValues) return [];
            return template.map(item => generateValue(item));
        }

        // 处理对象
        if (typeof template === 'object') {
            const result: any = {};
            Object.keys(template).forEach(key => {
                result[key] = generateValue(template[key]);
            });
            return result;
        }

        // 处理基本数据类型
        if (includeValues) {
            return template;
        } else {
            // 根据类型返回空值
            switch (typeof template) {
                case 'string':
                    return '';
                case 'number':
                    return null;
                case 'boolean':
                    return false;
                default:
                    return template;
            }
        }
    };

    // 模板数据（包含真实值）
    const templateData = {
        "generalInfo": {
            "productIdentifier": "CN PTL-00001   （此电池护照信息均为虚拟示例数据）",
            "batteryPassportIdentifier": "urn:aaaaaaa:aaaaaaa",
            "batteryCategory": "lmt",
            "manufacturerInformation": {
                "contactName": "张工",
                "postalAddress": {
                    "addressCountry": "中国",
                    "streetAddress": "深圳市宝安区石岩街道上屋社区爱群路同富裕工业区4",
                    "postalCode": "518000"
                },
                "identifier": "PTL",
                "emailAddress": "chenxiaoyan@ptl-global.com",
                "webAddress": "https://www.ptl-global.com/cn/"
            },
            "manufacturingDate": "2024-07-29T15:38:35.622Z",
            "batteryStatus": "Original",
            "batteryMass": 15.5,
            "manufacturingPlace": {
                "addressCountry": "中国",
                "streetAddress": "深圳市宝安区石岩街道上屋社区爱群路同富裕工业区4-7#厂房一层-五层(Building 4-7, Tongfuyu Industrial Park, Aiqun Road, Shiyan Street, Baoan District, Shenzhen, Guangdong, China)",
                "postalCode": "518000"
            },
            "operatorInformation": {
                "contactName": "李经理",
                "postalAddress": {
                    "addressCountry": "中国",
                    "streetAddress": "深圳市宝安区石岩街道上屋社区爱群路同富裕工业区4-7#厂房一层-五层(Building 4-7, Tongfuyu Industrial Park, Aiqun Road, Shiyan Street, Baoan District, Shenzhen, Guangdong, China)",
                    "postalCode": "100000"
                },
                "identifier": "91440300067171445G",
                "emailAddress": "chenxiaoyan@ptl-global.com",
                "webAddress": "https://www.ptl-global.com/cn/"
            },
            "puttingIntoService": "2024-12-04T15:29:34+08:00",
            "warrentyPeriod": "--01Z"
        },
        "materialComposition": {
            "batteryChemistry": {
                "shortName": "NCM",
                "clearName": "锂镍锰钴氧化物"
            },
            "batteryMaterials": [
                {
                    "batteryMaterialLocation": {
                        "componentName": "正极材料",
                        "componentId": "CAT-001"
                    },
                    "batteryMaterialIdentifier": "643778-32-4",
                    "batteryMaterialName": "钴酸锂",
                    "batteryMaterialMass": 2.3,
                    "isCriticalRawMaterial": true
                },
                {
                    "batteryMaterialLocation": {
                        "componentName": "阴极",
                        "componentId": "CAT-101"
                    },
                    "batteryMaterialIdentifier": "7782-42-5",
                    "batteryMaterialName": "天然石墨",
                    "batteryMaterialMass": 1,
                    "isCriticalRawMaterial": true
                }
            ],
            "hazardousSubstances": [
                {
                    "hazardousSubstanceClass": "AcuteToxicity",
                    "hazardousSubstanceName": "六氟磷酸锂",
                    "hazardousSubstanceConcentration": 0.5,
                    "hazardousSubstanceImpact": ["环境危害", "健康危害"],
                    "hazardousSubstanceLocation": {
                        "componentName": "电解液",
                        "componentId": "ELY-001"
                    },
                    "hazardousSubstanceIdentifier": "2632-16-1"
                }
            ]
        },
        "carbonFootprint": {
            "batteryCarbonFootprint": 85.2,
            "carbonFootprintPerLifecycleStage": [
                {
                    "lifecycleStage": "RawMaterialExtraction",
                    "carbonFootprint": 45.6
                },
                {
                    "lifecycleStage": "Production",
                    "carbonFootprint": 50
                }
            ],
            "carbonFootprintPerformanceClass": "A",
            "carbonFootprintStudy": "https://www.globalbattery.org/media/publications/gba-rulebook-v1.5-master.pdf"
        },
        "performanceData": {
            "batteryTechicalProperties": {
                "originalPowerCapability": [
                    {
                        "atSoC": 50,
                        "powerCapabilityAt": 150
                    }
                ],
                "ratedMaximumPower": 200,
                "powerCapabilityRatio": 0.75,
                "ratedEnergy": 60,
                "expectedNumberOfCycles": 3000,
                "initialSelfDischarge": 2,
                "roundtripEfficiency": 95,
                "ratedCapacity": 100,
                "initialInternalResistance": [
                    {
                        "ohmicResistance": 0.05,
                        "batteryComponent": "pack"
                    }
                ],
                "expectedLifetime": 10,
                "nominalVoltage": 3.7,
                "minimumVoltage": 2.8,
                "maximumVoltage": 4.2,
                "capacityThresholdForExhaustion": 80,
                "lifetimeReferenceTest": "http://xxx.com",
                "temperatureRangeIdleState": 60,
                "crate": 1,
                "crateLifeCycleTest": 1
            },
            "batteryCondition": {
                "energyThroughput": 15000,
                "capacityThroughput": {
                    "value": 12000,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "numberOfFullCycles": {
                    "value": 500,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "stateOfCertifiedEnergy": {
                    "value": 58,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "capacityFade": {
                    "value": 5,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "remainingEnergy": {
                    "value": 57,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "remainingCapacity": {
                    "value": 95,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "negativeEvents": [
                    {
                        "negativeEvent": "高温报警",
                        "lastUpdate": "2024-06-15T10:30:00.000Z"
                    }
                ],
                "temperatureInformation": {
                    "timeExtremeHighTemp": 2,
                    "timeExtremeLowTemp": 0,
                    "timeExtremeHighTempCharging": 1,
                    "timeExtremeLowTempCharging": 0,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "remainingPowerCapability": [
                    {
                        "atSoC": 50,
                        "powerCapabilityAt": 145
                    }
                ],
                "powerFade": 3,
                "roundTripEfficiencyFade": 2,
                "evolutionOfSelfDischarge": 1,
                "currentSelfDischargingRate": {
                    "value": 2.5,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "internalResistanceIncrease": [
                    {
                        "ohmicResistance": 0.055,
                        "batteryComponent": "pack"
                    }
                ],
                "roundTripEfficiencyat50PerCentCycleLife": 93,
                "remainingRoundTripEnergyEfficiency": {
                    "value": 93,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                },
                "stateOfCharge": {
                    "value": 65,
                    "lastUpdate": "2024-07-29T15:38:35.624Z"
                }
            }
        },
        "circularityInfo": {
            "dismantlingAndRemovalInformation": [
                {
                    "documentType": "BillOfMaterial",
                    "mimeType": "application/pdf",
                    "documentURL": "https://example.com/docs/bom.pdf"
                }
            ],
            "sparePartSources": [
                {
                    "nameOfSupplier": "电池配件有限公司",
                    "addressOfSupplier": {
                        "addressCountry": "中国",
                        "streetAddress": "配件园区供应路50号",
                        "postalCode": "215000"
                    },
                    "emailAddressOfSupplier": "parts@supplier.com",
                    "supplierWebAddress": "www.parts-supplier.com",
                    "components": [
                        {
                            "partName": "电池管理系统",
                            "partNumber": "BMS-001"
                        }
                    ]
                }
            ],
            "recycledContent": [
                {
                    "preConsumerShare": 15,
                    "recycledMaterial": "Cobalt",
                    "postConsumerShare": 25
                }
            ],
            "safetyMeasures": {
                "safetyInstructions": "http://xxx.com",
                "extinguishingAgent": ["干粉灭火器", "二氧化碳灭火器"]
            },
            "endOfLifeInformation": {
                "wastePrevention": "http://xxx.com",
                "separateCollection": "http://xxx.com",
                "informationOnCollection": "http://xxx.com"
            },
            "renewableContent": 30
        },
        "labelsConformity": {
            "declarationOfConformity": "http://xxx.com",
            "resultOfTestReport": "http://xxx.com",
            "labels": [
                {
                    "labelingSymbol": "http://xxx.com",
                    "labelingMeaning": {
                        "zh": "可回收标志",
                        "en": "可回收标志"
                    },
                    "labelingSubject": "SeparateCollection"
                }
            ]
        },
        "supplyChain": {
            "supplyChainDueDiligenceReport": "http://xxx.com",
            "thirdPartyAssurances": "http://xxx.com",
            "supplyChainIndices": 85
        },
        "createdAt": "2024-07-29T15:38:35.625Z",
        "updatedAt": "2024-07-29T15:38:35.625Z"
    };

    return generateValue(templateData);
}